/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bo;

import java.io.IOException;
import java.io.InputStream;

/**
 *
 * @author amine.tayaa
 */
public class SerialReader {
                InputStream in;

	        public SerialReader ( InputStream in )
	        {
	            this.in = in;
	        }

	        public void run ()
	        {
	            byte[] buffer = new byte[1024];
	            int len = -1;
                    System.out.println("        kjbjgfh");

                    System.out.println(in);
	            try
	            {
	                while ( ( len = this.in.read(buffer)) > -1 )
	                {
	                    System.out.print(new String(buffer,0,len));//tampon
	                }
	            }
	            catch ( IOException e )
	            {
	                e.printStackTrace();
	            }
	        }
}
